//
//  BVGoodFeelingViewController.m
//  XiangYu
//
//  Created by YYKJ on 2017/6/1.
//  Copyright © 2017年 YYKJ. All rights reserved.
//  有好感

#import "BVGoodFeelingViewController.h"
#import "BVGoodFeelingCell1.h"

#define BUY_GOODFEELING_TABLEVIEWCELL1 @"BVGoodFeelingCell1"

@interface BVGoodFeelingViewController ()<UITableViewDelegate ,UITableViewDataSource>

@property (nonatomic ,strong) UITableView      *tabView;

@end

@implementation BVGoodFeelingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view setBackgroundColor:[UIColor BVBackgroundLightGrayColor]];

    [self layoutUI];
}

-(void)layoutUI{

    [self.view addSubview:self.tabView];
}

#pragma mark -
#pragma mark - UITableViewDelegate,UITableViewDataSource
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    UIView *view = [UIView new];
    [view setBackgroundColor:[UIColor clearColor]];
    return view;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    BVGoodFeelingCell1 *cell = [tableView dequeueReusableCellWithIdentifier:BUY_GOODFEELING_TABLEVIEWCELL1];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    
    return cell;

}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
    
}

-(UITableView *)tabView{
    if (!_tabView) {
        self.tabView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, ScreenW, ScreenH-64-49) style:UITableViewStylePlain];
        [self.tabView setDelegate:self];
        [self.tabView setDataSource:self];
        [self.tabView setBackgroundColor:[UIColor clearColor]];
        [self.tabView setTableFooterView:[UIView new]];
        [self.tabView setShowsVerticalScrollIndicator:NO];
        [self.tabView setRowHeight:80];
        [self.tabView registerClass:[BVGoodFeelingCell1 class] forCellReuseIdentifier:BUY_GOODFEELING_TABLEVIEWCELL1];
        
    }
    
    return _tabView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

@end
